define(function(require) {
	var app = require('./app');

	//
	app.filter('debtTransferable', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 0) {
				out = '不可债转'
			}
			if (staus == 1) {
				out = '可债转'
			}
			return out;
		}
	});

	//是否可债转
	app.filter('debtTransferable', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 0) {
				out = '不可债转'
			}
			if (staus == 1) {
				out = '可债转'
			}
			return out;
		}
	});
	//用户类型
	app.filter('userType', function($sce) {
		return function(staus) {
			var out = '';
			if (staus == 1) {
				out = '投资用户'
			}
			if (staus == 2) {
				out = '借款用户'
			}
			if (staus == 3) {
				out = '借款企业'
			}
			return out;
		}
	});

	//红包作用范围
	app.filter('ruleScope', function($sce) {
		return function(staus) {
			var out = '';
			if (staus == 0) {
				out = '全部'
			}
			if (staus == 1) {
				out = '学车宝'
			}
			if (staus == 2) {
				out = '车商宝'
			}
			if (staus == 3) {
				out = '车贷宝'
			}
			return out;
		}
	});

//红包状态
	app.filter('ruleStatus', function($sce) {
		return function(staus) {
			var out = '';
			if (staus == 0) {
				out = '未审核'
			}
			if (staus == 1) {
				out = '未激活'
			}
			if (staus == 2) {
				out = '激活'
			}
			if (staus == 3) {
				out = '停用'
			}
			if (staus == 4) {
				out = '过期'
			}
			return out;
		}
	});

    //项目状态
	app.filter('itemStatusFilter', function($sce) {
		return function(staus) {
			var out = "";
			if (staus == 0) {
				out = "等待初审";
			}
			if (staus == 1) {
				out = "等待开放";
			}
			if (staus == 2) {
				out = "初审中";
			}
			if (staus == 10) {
				out = "通过初审";
			}
			if (staus == 11) {
				out = "初审失败";
			}
			if (staus == 13) {
				out = "撤回审核";
			}
			if (staus == 14) {
				out = "撤回成功";
			}
			if (staus == 18) {
				out = "项目截标";
			}
			if (staus == 20) {
				out = "项目满标";
			}
			if (staus == 21) {
				out = "满标成功";
			}
			if (staus == 22) {
				out = "复审失败";
			}
			if (staus == 23) {
				out = "复审审核";
			}
			if (staus == 30) {
				out = "复审通过待还款";
			}
			if (staus == 31) {
				out = "部分还款";
			}
			if (staus == 32) {
				out = "还款成功";
			}
			return out;
		}
	});
	//红包使用
	app.filter('couponName', function($sce) {
		return function(staus) {
			var out = ''
			if (staus ==null) {
				out = '未使用'
			}else{
				out = staus;
			}
			return out;
		}
	});

	//期数
	app.filter('periodsNum', function($sce) {
		return function(staus) {
			var out = ''
			if (staus ==null) {
				out = '0'
			}else{
				out = staus;
			}
			return out;
		}
	});
	//内容显示
	app.filter('typeContent', function($sce) {
		return function(staus) {
			var out = '';
			if(staus){
				out = staus.replace(/<.*?>/ig,"");
			}
			return out;
		}
	});
	//使用时间
	app.filter('useTime', function($sce) {
		return function(staus) {
			var out = ''
			if (staus ==null) {
				out = '暂未使用	'
			}else{
				out = staus;
			}
			return out;
		}
	});

	//文章类别
	app.filter('siteId', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = '行业信息	'
			}
			if (staus == 2) {
				out = '平台动态'
			}
			if (staus == 3) {
				out = '合作伙伴'
			}
			if (staus == 4) {
				out = '网站公告'
			}
			return out;
		}
	});

	//是否开启
	app.filter('articleStatus', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '隐藏	'
			}
			if (staus == 1) {
				out = '显示'
			}
			return out;
		}
	});
	//投资状态
	app.filter('investStatus', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 0) {
				out = '投标成功'
			}
			if (staus == 1) {
				out = '复审通过'
			}
			if (staus == 2) {
				out = '流标'
			}
			if (staus == 3) {
				out = '投资已还款'
			}
			return out;
		}
	});
	//优惠卷类型
	app.filter('couponType', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 1) {
				out = '红包'
			}
			if (staus == 2) {
				out = '加息券'
			}
			if (staus == 3) {
				out = '代金券'
			}
			return out;
		}
	});

	//使用状况
	app.filter('couponStatus', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 1) {
				out = '已使用'
			}
			if (staus == 2) {
				out = '未使用'
			}
			if (staus == 3) {
				out = '过期'
			}
			return out;
		}
	});

	//投资类型
	app.filter('investType', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 1) {
				out = '安卓端'
			}
			if (staus == 2) {
				out = 'iOS端'
			}
			if (staus == 5) {
				out = '自动投标'
			}
			if(staus == 7){
				out = '债权投资'
			}

			return out;
		}
	});
	//是否新手标
	app.filter('isnew', function($sce) {
		return function (staus) {
			var out = ''
			if (staus == 0) {
				out = '否'
			}
			if (staus == 1) {
				out = '是'
			}
			return out;
		}
	});

	
	
	//发送状态
	app.filter('sendStatus', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '发送失败'
			}
			if (staus ==1) {
					out = '发送成功'
			}
			return out;
		}
	});


	//充值类型
	app.filter('rechargeType', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = 'APP充值'
			}
			if (staus ==2) {
					out = '后台充值'
			}
			if (staus ==3) {
				out = '网页端充值'
			}
			if (staus ==4) {
				out = '微信端充值'
			}
			return out;
		}
	});
	//提前发送时间
	app.filter('advanceTime', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '及时发送'
			}
			if (staus > 0) {
					out = '提前'+staus+'天发送'
			}
			return out;
		}
	});
	//是否开启
	app.filter('extendStatus', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '关闭	'
			}
			if (staus == 1) {
				out = '开启'
			}
			return out;
		}
	});

	//金额类型
	app.filter('amountType', function($sce) {
		return function(staus) {
			var out = ''
			if (staus ==1) {
				out = '投资金额'
			}
			if (staus == 2) {
				out = '保留金额'
			}
			return out;
		}
	});

	//发送类型
	app.filter('sendType', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = '系统通知'
			}
			if (staus == 2) {
				out = '用户通知'
			}
			return out;
		}
	});
	//通知类型
	app.filter('noticeType', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '短信'
			}
			if (staus == 1) {
				out = '邮件'
			}
			if (staus == 2) {
				out = '站内消息'
			}
			return out;
		}
	});
	//收益类型
	app.filter('incomeType', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = '活期收益'
			}
			if (staus == 2) {
				out = '定期收益'
			}
			return out;
		}
	});
	app.filter('pictureStatus', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '关闭'
			}
			if (staus == 1) {
				out = '开启'
			}
			return out;
		}
	});
	app.filter('pictureType', function($sce) {
		return function(type) {
			var out = ''
			//if (type == 1) {
			//	out = 'PC端首页滚动'
			//}
			if (type == 6) {
				out = '移动端首页滚动'
			}
			//if (type == 8) {
			//	out = '项目图标'
			//}
			if (type == 7) {
				out = '活动中心'
			}
			if (type == 4) {
				out = '项目信息图片'
			}
			if (type == 9) {
				out = 'APP弹屏图片'
			}

			return out;
		}
	});


	//项目类型
	app.filter('itemType', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = '学车宝'
			}
			if (staus == 2) {
				out = '车商宝'
			}
			if (staus == 3) {
				out = '车贷宝'
			}
			return out;
		}
	});
	//还款方式
	app.filter('repayMethod', function() {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = '一次性还款'
			}
			if (staus == 2) {
				out = '等额本息'
			}
			if (staus == 3) {
				out = '先息后本'
			}
			if (staus == 4) {
				out = '每日付息'
			}
			if (staus == 5) {
				out = '等额本金'
			}
			return out;
		}
	});
	//每次最高投资
	app.filter('maxInvestment', function() {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '不设限'
			}
			return out;
		}
	});
	//起投资金
	app.filter('minInvestment', function() {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '不设起投'
			}
			return out;
		}
	});
	//项目最高投资
	app.filter('itemMaxInvest', function() {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '不设上限'
			}
			return out;
		}
	});
	//项目状态
	app.filter('itemStatus', function($sce) {
		return function(staus) {
			var out = ''
			if (staus == 0) {
				out = '正常发标'
			}
			if (staus == 1) {
				out = '项目失败'
			}
			return out;
		}
	});
	//项目期限
	app.filter('cycleUnit', function() {
		return function(staus) {
			var out = ''
			if (staus == 1) {
				out = '天'
			}
			if (staus == 3) {
				out = '月'
			}
			if (staus == 4) {
				out = '季'
			}
			if (staus == 5) {
				out = '年'
			}
			if (staus == 2) {
				out = '周'
			}
			return out;
		}
	});


	//（10--未处理，11--进件，12--风控人员， 13--财务人员，14--通知放款， 21 22 23  30--已放款,订单完成）
	app.filter('orderStatusFilter', function() {
		return function(staus) {
			var out = "";
			if (staus == 10) {
				out = "订单列表";
			}
			if (staus == 11) {
				out = "待受理订单";
			}
			if (staus == 12) {
				out = "受理中";
			}
			if (staus == 21) {
				out = "初审";
			}
			if (staus == 22) {
				out = "复审";
			}
			if (staus == 23) {
				out = "司法审";
			}
			if (staus == 30) {
				out = "领导1审";
			}
			if (staus == 31) {
				out = "领导2审";
			}
			if (staus == 40) {
				out = "财务放款";
			}
			if (staus == 50) {
				out = "贷后";
			}
			return out;
		}
	});
	app.filter('paymentStatus', function() {
		return function(paymentStatus) {
			var out = "";
			if (paymentStatus == 0) {
				out = "未还款";
			}
			if (paymentStatus == 1) {
				out = "借款人已还款";
			}
			if (paymentStatus == 2) {
				out = "标的已还款";
			}
			if (paymentStatus == 3) {
				out = "审核中";
			}
			return out;
		}
	});

	app.filter('sexStatus', function() {
		return function(sexStatus) {
			var out = "";
			if (sexStatus == 1) {
				out = "男";
			}
			if (sexStatus == 2) {
				out = "女";
			}
			return out;
		}
	});
	app.filter('permissionsStatus', function() {
		return function(permissionsStatus) {
			var out = "";
			if (permissionsStatus == 1) {
				out = "管理员";
			}
			if (permissionsStatus == 2) {
				out = "领导";
			}
			if (permissionsStatus == 3) {
				out = "财务";
			}
			if (permissionsStatus == 4) {
				out = "员工";
			}
			return out;
		}
	});
	//文章管理
	app.filter('siteIdStatus', function() {
		return function(siteIdStatus) {
			var out = "";
			if (siteIdStatus == 1) {
				out = "最新公告";
			}
			if (siteIdStatus == 2) {
				out = "帮助中心";
			}
			return out;
		}
	});
	//用户认证手机认证状态
	app.filter('phoneStatus', function() {
		return function(phoneStatus) {
			var out = "";
			if (phoneStatus == 0) {
				out = "未认证";
			}
			if (phoneStatus == 1) {
				out = "已认证";
			}
			if (phoneStatus == 2) {
				out = "已提交申请";
			}
			return out;
		}
	});
	//用户认证实名认证状态
	app.filter('realnameStatus', function() {
		return function(realnameStatus) {
			var out = "";
			if (realnameStatus == 0) {
				out = "未认证";
			}
			if (realnameStatus == 1) {
				out = "已认证";
			}
			if (realnameStatus == 2) {
				out = "已提交申请";
			}
			return out;
		}
	});
	//用户认证邮箱认证状态
	app.filter('emailStatus', function() {
		return function(emailStatus) {
			var out = "";
			if (emailStatus == 0) {
				out = "未认证";
			}
			if (emailStatus == 1) {
				out = "已认证";
			}
			if (emailStatus == 2) {
				out = "已提交申请";
			}
			return out;
		}
	});
	//充值记录状态
	app.filter('rechargeStatus', function() {
		return function(rechargeStatus) {
			var out = "";
			if (rechargeStatus == 0) {
				out = "失败";
			}
			if (rechargeStatus == 1) {
				out = "成功";
			}
			if (rechargeStatus == 2) {
				out = "审核中";
			}
			return out;
		}
	});
	//充值记录状态
	app.filter('withdrawalType', function() {
		return function(withdrawalType) {
			var out = "";
			if (withdrawalType == 1) {
				out = "T+0到账";
			}
			if (withdrawalType == 2) {
				out = "D+0到账";
			}
			if (withdrawalType == 3) {
				out = "T+1到账";
			}
			return out;
		}
	});
	//银行卡管理状态
	app.filter('bankcardStatus', function() {
		return function(bankcardStatus) {
			var out = "";
			if (bankcardStatus == 0) {
				out = "不启用";
			}
			if (bankcardStatus == 1) {
				out = "启用";
			}
			return out;
		}
	});
	//操作员管理性别
	app.filter('sexStatus', function() {
		return function(sexStatus) {
			var out = "";
			if (sexStatus == 0) {
				out = "女";
			}
			if (sexStatus == 1) {
				out = "男";
			}
			return out;
		}
	});
	//用户类型
	app.filter('customerType', function() {
		return function(customerType) {
			var out = "";
			if (customerType == 0) {
				out = "普通用户";
			}
			if (customerType == 1) {
				out = "业务员";
			}
			if (customerType == 2) {
				out = "员工";
			}
			if (customerType == 3) {
				out = "渠道用户";
			}
			if (customerType == 4) {
				out = "线下用户";
			}
			if (customerType == 5) {
				out = "其它客户";
			}
			return out;
		}
	});
	app.filter('sysUserType', function() {
		return function(type) {
			var out = "";
			if (type == 1) {
				out = "员工";
			}
			if (type == 2) {
				out = "资方";
			}
			if (type == 3) {
				out = "业务员";
			}
			if (type == 4) {
				out = "平台账户";
			}
			return out;
		}
	});
	app.filter('dayDiff', function() {
		return function(daytime) {
			var out = "";
			if (daytime < 0) {
				out = "已到期";
			}
			if (daytime >= 0) {
				out = daytime;
			}
			return out;
		}
	});
	app.filter('itemPictureType', function() {
		return function(type) {
			var out = "";
			if (type == 1) {
				out = "个人资料";
			}
			if (type == 2) {
				out = "车辆图片";
			}
			if (type == 3) {
				out = "相关手续";
			}
			return out;
		}
	});

	app.filter('formatMoney', function() {
		return function (money) {
			if (money >= 0) {
				out = money;
			}
			if (out == null) {
				out = 0;
			}
			return '￥' + out;
		}
	});
	//抽奖来源转义
	app.filter('lotteryWay', function() {
	return function(type) {
		var out = "";
		if (type == "invest_get_lotteryNum" || type == "INVEST_GET_LOTTERYNUM") {
			out = "累计投资";
		}else if (type == "login_get_lotteryNum" || type == "LOGIN_GET_LOTTERYNUM") {
			out = "每日登陆";
		}else if (type == "first_login_get_lotteryNum" || type == "FIRST_LOGIN_GET_LOTTERYNUM") {
			out = "首次登陆";
		}else if(type == "sys_get_lotteryNum" || type == "SYS_GET_LOTTERYNUM"){
			out = "系统添加";
		}else{
			out = "其他";
		}
		return out;
	}
	});

	//奖励列表是否发放
	app.filter('lotteryLogStatus', function() {
		return function(type) {
			var out = "";
			if (type == 1) {
				out = "已发放";
			}else if (type == 2) {
				out = "未发放";
			}else{
				out = "其他";
			}
			return out;
		}
	});
	
	//奖励列表是否最差
	app.filter('isLast', function() {
		return function(type) {
			var out = "";
			if (type == 0) {
				out = "否";
			}else if (type == 1) {
				out = "是";
			}
			return out;
		}
	});
	
	//奖励列表是否实物
	app.filter('isRealObject', function() {
		return function(type) {
			var out = "";
			if (type == 0) {
				out = "否";
			}else if (type == 1) {
				out = "是";
			}
			return out;
		}
	});
	
	//奖励类型
	app.filter('wardType', function() {
		return function(type) {
			var out = "";
			if (type == 1) {
				out = "普通红包";
			}else if (type == 2) {
				out = "加息券";
			}else if (type == 3) {
				out = "现金红包";
			}else if (type == 4) {
				out = "实物";
			}
			return out;
		}
	});

	//金钱单位
	app.filter('moneyUnit', function() {
		return function(money) {
			var out = "";
			if (!money) {
				out = "无";
			}else{
				out = money+"元";
			}
			return out;
		}
	});
	//百分率单位
	app.filter('percentUnit', function() {
		return function(percent) {
			var out = "";
			if (!percent) {
				out = "无";
			}else{
				out = percent+"%";
			}
			return out;
		}
	});
	//时间单位
	app.filter('dateUnit', function() {
		return function(date) {
			var out = "";
			if (!date) {
				out = "无";
			}else{
				out = date+"天";
			}
			return out;
		}
	});
	
	//指定用户状态
	app.filter('appointstatus', function() {
		return function(appointstatus) {
			var out = "";
			if (appointstatus==0) {
				out = "未使用";
			}else if(appointstatus==1){
				out = "已使用";
			}
			return out;
		}
	});

	//类型
	app.filter('typeNum', function() {
		return function(typeNum) {
			var out = "";
			if (typeNum==1) {
				out = "充值";
			}else if(typeNum==2){
				out = "提现";
			}
			return out;
		}
	});

	//状态
	app.filter('statusNum', function() {
		return function(statusNum) {
			var out = "";
			if (statusNum==0) {
				out = "失败";
			}else if(statusNum==1){
				out = "成功";
			}else if(statusNum==2){
				out = "审核中";
			}
			return out;
		}
	});

	//订单金额
	app.filter('orderNum', function() {
		return function(orderNum) {
			var out = orderNum;

			return out  + '元';
		}
	});
});